package com.example.app.pages.main.home.addNew

import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.rounded.ArrowForwardIos
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.unit.dp
import com.example.app.components.MyField.MyField
import com.example.app.components.MyIcon.MyIcon
import com.example.app.components.MyIcon.MySelectorIcon
import com.example.app.components.MyImage.MyAsyncSvgImage
import com.example.app.components.MyListItem.MyListItem
import com.example.app.components.MySpacer.MySpacer
import com.example.app.components.MyText.MyText
import com.example.app.viewmodel.AddNewChild
import com.example.app.viewmodel.RouteViewModel

@Composable
fun AddNewBtns(
        paddingValues: PaddingValues,
        routeViewModel: RouteViewModel,
) {
    Column(
        modifier = androidx.compose.ui.Modifier.padding(paddingValues)
    ) {
        MySpacer(modifier = Modifier.height(12.dp))

        MyListItem(
            modifier = Modifier
                .clip(
                    androidx.compose.foundation.shape.RoundedCornerShape(
                        com.example.app.ui.theme.shapeLarge
                    )
                )
                .clickable {
                    routeViewModel.flowUpdate_curAddNewChild(AddNewChild.ADD_RECORD)
                },
            headlineContent = {
                MyField(labelContent = {
                    Row(
                        horizontalArrangement = Arrangement.Start,
                        verticalAlignment = Alignment.CenterVertically
                    ) {
                        MyAsyncSvgImage(path = "color_svg_94.svg")
                        MySpacer(modifier = Modifier.width(4.dp))
                        MyText(text = "新建账目")
                    }
                },
                    valueContent = {
                        MySelectorIcon()
                    })
            },
            hasWrap = true
        )
        MySpacer(modifier = Modifier.height(12.dp))

        MyListItem(
            headlineContent = {
                MyField(labelContent = {
                    Row(
                        horizontalArrangement = Arrangement.Start,
                        verticalAlignment = Alignment.CenterVertically
                    ) {
                        MyAsyncSvgImage(path = "color_svg_7.svg")
                        MySpacer(modifier = Modifier.width(4.dp))
                        MyText(text = "新增笔记")
                    }
                },
                    valueContent = {
                        MySelectorIcon()
                    })
            },
            hasWrap = true
        )
        MySpacer(modifier = Modifier.height(12.dp))

        MyListItem(
            headlineContent = {
                MyField(labelContent = {
                    Row(
                        horizontalArrangement = Arrangement.Start,
                        verticalAlignment = Alignment.CenterVertically
                    ) {
                        MyAsyncSvgImage(path = "color_svg_144.svg")
                        MySpacer(modifier = Modifier.width(4.dp))
                        MyText(text = "新增待办")
                    }
                },
                    valueContent = {
                        MySelectorIcon()
                    })
            },
            hasWrap = true
        )
    }
}